<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .one {
            font-size: 20px;
            color: darkblue;
        }
        #get:active{
            background-color: aquamarine;
        }
        #post:active{
            background-color: red;
        }
        #put:active{
            background-color: rebeccapurple;
        }
        #delete:active{
            background-color: royalblue;
        }
    </style>
</head>
<body>
    <script src="https://code.jquery.com/jquery-3.6.1.min.js"></script>
    <button id = "get">get</button>
    <button id = "post">post</button>
    <button id = "put">put</button>
    <button id = "delete">delete</button>
    <div class = "one"></div>
    <script>

        let oneGet = document.querySelector('#get');
        oneGet.onclick = function() {
            $.ajax({
                type: 'get',
                url: 'hello',
                success: function(body){
                    let div = document.querySelector('.one');
                    div.innerHTML = body;
                }
            })
        }

        let onePut = document.querySelector('#put');
        onePut.onclick = function() {
            $.ajax({
                type: 'put',
                url: 'hello',
                success: function(body){
                    let div = document.querySelector('.one');
                    div.innerHTML = body;
                }
            })
        }

        let oneDelete = document.querySelector('#delete');
        oneDelete.onclick = function() {
            $.ajax({
                type: 'delete',
                url: 'hello',
                success: function(body){
                    let div = document.querySelector('.one');
                    div.innerHTML = body;
                }
            })
        }
        
        let onePost = document.querySelector('#post');
        onePost.onclick = function(){
            $.ajax({
                type: 'post',
                url: 'hello',
                success: function(body) {
                    let div = document.querySelector('.one');
                    div.innerHTML = body;
                }
            });
        }

    </script>
</body>
</html>